from django.db import models
from apps.common.base.models import BaseModel
from apps.interface.client.models import Client
from apps.interface.page.models import Page

class PageConfig(BaseModel):

    status = (
        (0, "关闭"),
        (1, "正常"),
    )
    clients=models.ManyToManyField(Client, related_name='pageConfig_client', blank=True, default=[], db_constraint=False)
    pagee=models.ForeignKey(Page, related_name='pageConfig_pagee', verbose_name='所属界面', on_delete=models.SET_NULL, null=True, blank=True, db_constraint=False)

    status = models.IntegerField("状态", choices=status, default=1)
    title=models.CharField("标题", max_length=200, blank=True, default='')
    key = models.CharField("标识", max_length=200, blank=True, default='')
    isRoot = models.BooleanField('是否为主界面', default=0)
    
    navigationBarBackground=models.CharField("导航栏背景色", max_length=200, blank=True, null=True, default='')
    background=models.CharField("页面背景色", max_length=200, blank=True, null=True, default='')

    options1=models.CharField("可选项1", max_length=200, blank=True, null=True, default='')
    options2=models.CharField("可选项2", max_length=200, blank=True, null=True, default='')

    isShow1=models.BooleanField("是否显示1", blank=True, default=True)
    isShow2=models.BooleanField("是否显示1", blank=True, default=True)

    text1=models.CharField("文本1", max_length=200, blank=True, null=True, default='')
    text2=models.CharField("文本2", max_length=200, blank=True, null=True, default='')
    text3=models.CharField("文本3", max_length=200, blank=True, null=True, default='')
    text4=models.CharField("文本4", max_length=200, blank=True, null=True, default='')

    longtext=models.CharField("长文本", max_length=10000, blank=True, null=True, default='')
    
    class Meta:
        verbose_name = 'PageConfig'
        verbose_name_plural = verbose_name